home *** CD-ROM | disk | FTP | other *** search
-
-
- /*********************************************/
- /* */
- /* Designer (C) Ian OConnor 1994 */
- /* */
- /* Designer Produced C include file */
- /* */
- /*********************************************/
-
- #include <exec/types.h>
- #include <exec/memory.h>
- #include <dos/dosextens.h>
- #include <intuition/screens.h>
- #include <intuition/intuition.h>
- #include <intuition/gadgetclass.h>
- #include <libraries/gadtools.h>
- #include <diskfont/diskfont.h>
- #include <utility/utility.h>
- #include <graphics/gfxbase.h>
- #include <workbench/workbench.h>
- #include <graphics/scale.h>
- #include <clib/exec_protos.h>
- #include <clib/wb_protos.h>
- #include <clib/intuition_protos.h>
- #include <clib/gadtools_protos.h>
- #include <clib/graphics_protos.h>
- #include <clib/utility_protos.h>
- #include <string.h>
- #include <clib/diskfont_protos.h>
-
- #include "UserViewer.h"
-
-
- ULONG BevelTags[] =
- {
- (GTBB_Recessed), TRUE,
- (GT_VisualInfo), 0,
- (TAG_DONE)
- };
-
- struct IntuiText UVTexts[] =
- {
- 2, 3, JAM1, 164, 74, &topa81281, (UBYTE *)"User Viewer (C) 1995 D.Clifton - Deluxe Software Ltd.", NULL
- };
-
- struct Window *UV = NULL;
- APTR UVVisualInfo;
- APTR UVDrawInfo;
- struct Gadget *UVGList;
- struct Gadget *UVGadgets[3];
- UBYTE UVFirstRun = 0;
-
- ULONG UVGadgetTags[] =
- {
- (GTLV_ShowSelected), 0,
- (GTLV_Selected), 0,
- (TAG_END),
- };
-
- UWORD UVGadgetTypes[] =
- {
- LISTVIEW_KIND,
- BUTTON_KIND,
- BUTTON_KIND,
- };
-
- struct NewGadget UVNewGadgets[] =
- {
- 1, 1, 590, 68, NULL, &topaz800, LV1, 1, NULL, (APTR)&UVGadgetTags[0],
- 1, 70, 78, 16, (UBYTE *)"About", &topaz800, UV_ABOUT, 16, NULL, NULL,
- 79, 70, 78, 16, (UBYTE *)"Update", &topaz800, UV_UPDATE, 16, NULL, NULL,
- };
- UWORD UVZoomInfo[4] = { 0, 0, 200, 11 };
-
- struct TextAttr topa81281 = { (STRPTR)"topaz", 8, 128, 1 };
- struct TextAttr topaz800 = { (STRPTR)"topaz.font", 8, 0, 0 };
-
- void RendWindowUV( struct Window *Win, void *vi )
- {
- int loop;
- UWORD offx = Win->BorderLeft;
- UWORD offy = Win->BorderTop;
- if (Win != NULL)
- {
- BevelTags[3] = (ULONG)vi;
- DrawBevelBoxA( Win->RPort, 158+offx,70+offy,433,16, (struct TagItem *)(&BevelTags[2]));
- for( loop=0; loop<1; loop++)
- if (UVTexts[loop].ITextFont==NULL)
- UVTexts[loop].ITextFont=Win->WScreen->Font;
- PrintIText( Win->RPort, UVTexts, offx, offy);
- }
- }
-
- int OpenWindowUV( void )
- {
- struct Screen *Scr;
- UWORD offx, offy;
- UWORD loop;
- struct NewGadget newgad;
- struct Gadget *Gad;
- struct Gadget *Gad2;
- APTR Cla;
- if (UVFirstRun == 0)
- {
- UVFirstRun = 1;
- }
- if (UV == NULL)
- {
- Scr = LockPubScreen((UBYTE *)"CtrlScrn");
- if (NULL != Scr)
- {
- offx = Scr->WBorLeft;
- offy = Scr->WBorTop + Scr->Font->ta_YSize+1;
- if (NULL != ( UVVisualInfo = GetVisualInfoA( Scr, NULL)))
- {
- if (NULL != ( UVDrawInfo = GetScreenDrawInfo( Scr)))
- {
- UVGList = NULL;
- Gad = CreateContext( &UVGList);
- for ( loop=0 ; loop<3 ; loop++ )
- if (UVGadgetTypes[loop] != 198)
- {
- CopyMem((char * )&UVNewGadgets[loop], ( char * )&newgad, (long)sizeof( struct NewGadget ));
- newgad.ng_VisualInfo = UVVisualInfo;
- newgad.ng_LeftEdge += offx;
- newgad.ng_TopEdge += offy;
- UVGadgets[ loop ] = NULL;
- UVGadgets[ newgad.ng_GadgetID - UVFirstID ] = Gad = CreateGadgetA( UVGadgetTypes[loop], Gad, &newgad, newgad.ng_UserData );
- }
- for ( loop=0 ; loop<3 ; loop++ )
- if (UVGadgetTypes[loop] == 198)
- {
- UVGadgets[ loop ] = NULL;
- Cla = NULL;
- if (Gad)
- UVGadgets[ loop ] = Gad2 = (struct Gadget *) NewObjectA( (struct IClass *)Cla, UVNewGadgets[ loop ].ng_GadgetText, UVNewGadgets[ loop ].ng_UserData );
- }
- if (Gad != NULL)
- {
- if (NULL != (UV = OpenWindowTags( NULL, (WA_Left), 15,
- (WA_Top), 119,
- (WA_Width), 596+offx,
- (WA_Height), 89+offy,
- (WA_Title), "User Viewer",
- (WA_ScreenTitle), "User Viewer (C) 1995 Dominic Clifton - Deluxe Software Ltd.",
- (WA_MinWidth), 200,
- (WA_MinHeight), 11,
- (WA_MaxWidth), 1200,
- (WA_MaxHeight), 1200,
- (WA_DragBar), TRUE,
- (WA_DepthGadget), TRUE,
- (WA_CloseGadget), TRUE,
- (WA_Activate), TRUE,
- (WA_Dummy+0x30), TRUE,
- (WA_SmartRefresh), TRUE,
- (WA_AutoAdjust), TRUE,
- (WA_Gadgets), UVGList,
- (WA_Zoom), UVZoomInfo,
- (WA_PubScreen) , (LONG)Scr,
- (WA_IDCMP),4194940,
- (TAG_END))))
- {
- RendWindowUV(UV, UVVisualInfo );
- GT_RefreshWindow( UV, NULL);
- RefreshGList( UVGList, UV, NULL, ~0);
- UnlockPubScreen( NULL, Scr);
- return( 0L );
- }
- }
- FreeGadgets( UVGList);
- FreeScreenDrawInfo( Scr, UVDrawInfo );
- }
- FreeVisualInfo( UVVisualInfo );
- }
- UnlockPubScreen( NULL, Scr);
- }
- }
- else
- {
- WindowToFront(UV);
- ActivateWindow(UV);
- return( 0L );
- }
- return( 1L );
- }
-
- void CloseWindowUV( void )
- {
- if (UV != NULL)
- {
- FreeScreenDrawInfo( UV->WScreen, UVDrawInfo );
- UVDrawInfo = NULL;
- CloseWindow( UV);
- UV = NULL;
- FreeVisualInfo( UVVisualInfo);
- FreeGadgets( UVGList);
- }
- }
-
-